/**
 * <p>Title: ZMCSEngineeringCustomView.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 张小飞
 * @version 1.0
 * <pre>Histroy:
 *          2011-6-1 下午03:46:30  张小飞  Create
 *</pre>
 */
package com.baosight.sczx.zm.cs.domain;

import com.baosight.iplat4j.ep.DaoEPBase;
import com.baosight.iplat4j.core.ei.EiColumn;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * <p>
 * Title: ZMCSEngineeringCustomView.java
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: Baosight Software LTD.co Copyright (c) 2002
 * </p>
 * <p>
 * Company: Baosight Software
 * </p>
 * 
 * @author 张小飞
 * @version 1.0
 * 
 *          <pre>
 * Histroy:
 *          2011-6-1 下午03:46:30  张小飞  Create
 * </pre>
 */
public class ZMCSEngineeringCustomView extends DaoEPBase {
	private String fdKeyId = " "; /* 主键 */
	private String fdTableName = " "; /* 表名称 */
	private String fdNo = " "; /* 编号 */
	private String fdName = " "; /* 名称 */
	private String fdAbbreviation = " "; /* 简称 */
	private String fdCategory = " "; /* 类型 */

	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdKeyId");
		// eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("FD_KEY_ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdTableName");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("对应表名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdNo");
		eiColumn.setFieldLength(10);
		eiColumn.setDescName("编号");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdName");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdAbbreviation");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName("简称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdCategory");
		eiColumn.setFieldLength(30);
		eiColumn.setDescName("类型");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCSEngineeringCustomView() {
		initMetaData();
	}

	/**
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return fdKeyId;
	}

	/**
	 * @param fdKeyId
	 *            the fdKeyId to set
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * @return the fdTableName
	 */
	public String getFdTableName() {
		return fdTableName;
	}

	/**
	 * @param fdTableName
	 *            the fdTableName to set
	 */
	public void setFdTableName(String fdTableName) {
		this.fdTableName = fdTableName;
	}

	/**
	 * @return the fdNo
	 */
	public String getFdNo() {
		return fdNo;
	}

	/**
	 * @param fdNo
	 *            the fdNo to set
	 */
	public void setFdNo(String fdNo) {
		this.fdNo = fdNo;
	}

	/**
	 * @return the fdName
	 */
	public String getFdName() {
		return fdName;
	}

	/**
	 * @param fdName
	 *            the fdName to set
	 */
	public void setFdName(String fdName) {
		this.fdName = fdName;
	}

	/**
	 * @return the fdAbbreviation
	 */
	public String getFdAbbreviation() {
		return fdAbbreviation;
	}

	/**
	 * @param fdAbbreviation
	 *            the fdAbbreviation to set
	 */
	public void setFdAbbreviation(String fdAbbreviation) {
		this.fdAbbreviation = fdAbbreviation;
	}

	/**
	 * @return the fdCategory
	 */
	public String getFdCategory() {
		return fdCategory;
	}

	/**
	 * @param fdCategory
	 *            the fdCategory to set
	 */
	public void setFdCategory(String fdCategory) {
		this.fdCategory = fdCategory;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdTableName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdTableName")), fdTableName));
		setFdNo(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdNo")), fdNo));
		setFdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdName")), fdName));
		setFdAbbreviation(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdAbbreviation")), fdAbbreviation));
		setFdCategory(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdCategory")), fdCategory));
	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdTableName", StringUtils.toString(fdTableName, eiMetadata.getMeta("fdTableName")));
		map.put("fdNo", StringUtils.toString(fdNo, eiMetadata.getMeta("fdNo")));
		map.put("fdName", StringUtils.toString(fdName, eiMetadata.getMeta("fdName")));
		map.put("fdAbbreviation", StringUtils.toString(fdAbbreviation, eiMetadata.getMeta("fdAbbreviation")));
		map.put("fdCategory", StringUtils.toString(fdCategory, eiMetadata.getMeta("fdCategory")));
		return map;

	}
}
